﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReprojectWebMercator
{
    public partial class CesiumGLSL : GLSLFuncBase
    {
        public vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
        {
            vec4 q = czm_projection * positionEC;                        // clip coordinates
            q.xyz /= q.w;                                                // normalized device coordinates
            q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0f)).xyz; // window coordinates
            return q;
        }
    }
}
